package com.elinkway.infinitemovies.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

public class NoScrollListView extends ListView {
	public NoScrollListView(Context context) {
		super(context);
	}
	private boolean isOnMeasure;

	public boolean isOnMeasure() {
		return isOnMeasure;
	}

	public void setOnMeasure(boolean onMeasure) {
		isOnMeasure = onMeasure;
	}

	public NoScrollListView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
				MeasureSpec.AT_MOST);
		isOnMeasure = true;
		super.onMeasure(widthMeasureSpec, expandSpec);
	}

	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
		isOnMeasure = false;
		super.onLayout(changed, l, t, r, b);
	}
}
